$(function($) { 
	var wHeight = $(window).height();
	var wWidth = $(window).width();
	console.log("wHeight=="+wHeight);
	var tHeight = parseInt( wHeight -52 -40-30-221-41 - 15 );
	console.log("tHeight=="+tHeight);
	var tWidth = parseInt( wWidth - 40 );
	var dWidth = parseInt( wWidth - 800  );
	var mHeight = parseInt( wHeight -10 - 40 - 100 );
	console.log("mHeight=="+mHeight);
	
	 
	
	$('#tableData').slimScroll({ 
		//width:tWidth, 
		height: tHeight,
		color: '#666',
		size:'5px',
		alwaysVisible:true,
		railVisible:true,//滚动条背景轨迹,默认false
		railColor:'#ccc',//滚动条背景轨迹颜色,默认#333333
		railOpacity:0.6,//滚动条背景轨迹透明度,默认0.2
	}); 
	
	
	 
	$('#detailBox').modal('show');
	

	//注册协议
	$(document).on("click", "#protocolBtn", function(e) {
			
	});
	
	
})
	
	//验证手机号
	function checkPhone(userAccountElement){   
		var phone = userAccountElement.val();   
		var reg_phone=/^(1[34578]\d{9})$/;  
		if(phone==null || phone.length==0 )
		{
			alertMsgs("手机号不能为空");
		}else{ 
			if( reg_phone.test(phone)){   
				return true;
			}else{
				alertMsgs("手机号码格式不正确");
				return false;
			} 
		} 
	} 
	//验证是否为空
	function checknull(inputElement,msg) 
	{
		var inputElementcon = inputElement.val();
		if(inputElementcon==null||inputElementcon.length==0)
		{ 
			alertMsgs(msg);
			return false; 
		}else{ 
			return true;	 
		}
	} 
	//消息提醒
	function alertMsgs(bodyStr){
		$.alert({
          hasfoot: false,
          backdrop: false,
		  closeBtn: false,
		  width:300,
		  height:30, 
          title: '提示',
          body: bodyStr,
          timeout: 1000
        });
	}
	
	
	
	/*for(var i=0;i<20;i++){
	$('#orderList').append('<tr><td class="odNum">1198381002'+i+'</td> <td class="odDate">2016-10-10 09:46:48.0</td> <td class="odPro">肠造瘘口-更换造口袋</td> <td class="odObj">健康康</td> <td class="odTel">15900570620</td> <td class="odStatus">已支付</td> <td class="odType">抢单</td> <td class="odCov">不同意</td> <td class="odOprate"><a href="javascript:void(0);" class="sui-btn btn-bordered btn-large btn-success detailBtn">详情&gt;&gt;</a></td></tr>');
	} 
	$('#selectBtn').click(function(){
		alertMsgs("不能为空");
	});
	var detailStr = '<div class="page-container"> <div class="contLeft"> <div class="tableDiv table-border radius box-shadow"> <div class="tableNav"> <font class="mr-10">订单号</font>11983810021 </div> <div class="tableCon"> <div class="sui-row tableRow nopadding"> <div class="span1 text-r"> 下单时间： </div> <div class="span2"> 2016-10-10 09:46:48.0 </div> <div class="span1 text-r"> 订单状态： </div> <div class="span2"> 用户已付款 </div> <div class="span1 text-r"> 订单金额： </div> <div class="span1"> 145.00 </div> </div> <div class="sui-row tableRow nopadding"> <div class="span1 text-r"> 支付时间： </div> <div class="span2"> 2016-10-10 09:46:48.0 </div> <div class="span1 text-r"> 服务项目： </div> <div class="span2"> 肠造瘘口-更换造口袋 </div> <div class="span1 text-r"> 实付金额： </div> <div class="span1"> 145.00 </div> </div> <div class="sui-row tableRow nopadding"> <div class="span1 text-r"> 接单时间： </div> <div class="span2"> 2016-10-10 09:46:48.0 </div> <div class="span1 text-r"> 服务时间： </div> <div class="span2"> 2016-10-10 09:46:48.0 </div>  </div> <div class="sui-row tableRow"> <div class="span1 text-r"> 患者情况： </div> <div class="span7 dashSpan pd-10"> 无 </div>  </div> <div class="sui-row tableRow nopadding"> <div class="span1 text-r"></div><div class="span7 text-r pd-10"> <a href="javascript:void(0);" class="sui-btn btn-bordered btn-xlarge btn-success export">查看医嘱</a> </div>  </div> </div> </div> <div class="tableDiv table-border radius box-shadow mt-30"> <div class="tableNav"> 退款信息 </div> <div class="tableCon"> <div class="sui-row tableRow nopadding"> <div class="span1 text-r"> 退款金额： </div> <div class="span2"> 145.00 </div> <div class="span1 text-r"> 退款原因： </div> <div class="span3"> 肠造瘘口-更换造口袋 </div>  </div> <div class="sui-row tableRow"> <div class="span1 text-r"> 退款说明： </div> <div class="span7 dashSpan pd-10"> 无 </div>  </div> </div> </div> <div class="tableDiv mt-30"> <div class="sui-row tableRow nopadding btnRow"> <a href="javascript:void(0);" class="sui-btn btn-xlarge btn-link updateBtn"><i class="iconfont icon-iupdates mr-5"></i>编辑订单信息</a> <!--<a href="javascript:void(0);" class="sui-btn btn-xlarge btn-link"><i class="iconfont icon-iupdate mr-5"></i>修改退款信息</a>--> <a href="javascript:void(0);" class="sui-btn btn-xlarge btn-link"><i class="iconfont icon-irefund mr-5"></i>申请退款</a> </div> </div> </div> <div class="contRight"> <div class="tableDiv table-border radius box-shadow"> <div class="tableNav"> 服务对象信息 </div> <div class="tableCon pd-5"> <div class="sui-row tableRow"> <div class="span1 text-c "> 滴滴滴 </div> <div class="span1"> 女 <div class="f-r mr-30"> 40 </div> </div> <div class="span1 f-r mr-20"> 15900578855 </div> </div> <div class="line dashBorder"></div> <div class="sui-row tableRow"> <div class="span text-l pl-30"> 上海市普陀区金沙江路1340弄8号敦奴大厦11楼 </div> </div> </div> </div> <div class="tableDiv table-border radius box-shadow mt-30"> <div class="tableNav"> 服务人员信息 </div> <div class="tableCon pd-5"> <div class="sui-row tableRow"> <div class="span1 text-c "> 哒哒哒 </div> <!--<div class="span1"> 女 <div class="f-r mr-30"> 40 </div> </div>--> <div class="span1 f-r mr-20"> 15900578855 </div> </div> <div class="line dashBorder"></div> <div class="sui-row tableRow"> <div class="span text-l pl-30"> 所属医院:上海市华东医院 </div> </div> </div> </div> </div> </div>';
	$('.detailBtn').click(function(){ 
		alert("dafas");
		$.alert({
			id:'detailModal',
			backdrop: true,//  决定是否为模态对话框添加一个背景遮罩层。另外，该属性指定static时，表示添加遮罩层，同时点击模态对话框的外部区域不会将其关闭。
			bgcolor: '#000',//   背景遮罩层颜色，默认是黑色。可以用rgba设置透明度
			keyboard: false,//   是否可由esc按键关闭
			title: '订单详情',
			body: detailStr, 
			closeBtn: true,   //是否显示右上角叉叉（html使用方式无需配置，直接改html结构即可））
			hasfoot: false,  //是否显示脚部  默认true
			width: tWidth,	 
			height:mHeight,
			show:function(e){ 
					$('.sui-modal .modal-body').css("max-height",mHeight);
			},
			shown:function(e){},
			hide:function(e){} 
		})
	});

	var updateStr='<div class="page-container"> <div class="tableDiv table-border radius box-shadow mt-30"> <div class="tableCon"> <div class="sui-row tableRow nopadding"> <div class="span2 text-r"> 联系电话： </div> <div class="span4"> <input type="text" placeholder="请输入联系电话" class="input-text radius size-M" value=""> </div>  </div> <div class="sui-row tableRow nopadding"> <div class="span2 text-r"> 服务地址： </div> <div class="span4"> <input type="text" placeholder="请输入服务地址" class="input-text radius size-M" value=""> </div>  </div> <div class="sui-row tableRow"> <div class="span3 text-r"> <a href="javascript:void(0);" class="sui-btn btn-xlarge btn-success" id="saveBtn">确定保存</a> </div> <div class="span3 text-c"> <a href="javascript:void(0);" class="sui-btn btn-xlarge btn-primary" id="resetBtn">重&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;置</a> </div>  </div> </div> </div> </div>';
	$(document).on("click", ".updateBtn", function(e){ 
		//$('#detailModal').modal('shadeIn');
		console.log("updateBtn");
		$.alert({
			id:'updateModal',
			backdrop: true,//  决定是否为模态对话框添加一个背景遮罩层。另外，该属性指定static时，表示添加遮罩层，同时点击模态对话框的外部区域不会将其关闭。
			bgcolor: '#000',//   背景遮罩层颜色，默认是黑色。可以用rgba设置透明度
			keyboard: false,//   是否可由esc按键关闭
			title: '订单详情',
			body: updateStr,
			backdrop:false,
			closeBtn: true,   //是否显示右上角叉叉（html使用方式无需配置，直接改html结构即可））
			hasfoot: false,  //是否显示脚部  默认true
			width: dWidth,	 
			//height:mHeight,
			show:function(e){
				 
				},
			shown:function(e){},
			hide:function(e){
				//$('#detailModal').modal('shadeOut');
			} 
		})
	}); 
*/

	